This forum is closed to new posts and
responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:
I'm pretty sure it has been that way since 6.0, but that doesn't mean it's not a bug.
I didn't know that about Val() -- that's interesting. But Val() also handles a much larger set of string cases than @ToNumber. For example, Val("&HFF") works, but @ToNumber throws an error.
And all of the other script conversion functions (Cstr, Cint, Cdbl, etc.) throw an error if you pass them an empty string.
I guess that whether or not it's a bug technically depends on the intended behavior of @ToNumber. If it's supposed to be a carbon-copy of Val(), it's OK to return 0 for "". But then what about all of the other cases Val handles that @ToNumber doesn't?
I was under the impression that the intent of @ToNumber was to be a shortcut for @TextToNumber(@Text(x)) for cleaner, more elegant code. Similar to @IfError -- an intended shortcut for @If(@IsError(x); y; x)
If @ToNumber is supposed to return 0 when passed "", I would think it should return 0 when passed " " as well, but it doesn't. If returning 0 is the correct behavior, then the Designer help really needs to be updated to explain this case, because that dramatically reduces its usability.
Feedback response number ECBS7FGRMT created by ~Dana Elfreekony on 06/10/2008